<html>
<!-- $LastChangedDate: 2009-11-07 22:56:33 -0500 (Sat, 07 Nov 2009) $ -->
<!-- Copyright (C) 2004,2009 Jim Brooks http://www.palomino3d.org -->
<head>
<title>Palomino - Configuration</title>
<link rel='stylesheet' type='text/css' href='docs.css'>
<link rel='icon' type='image/png' href='images/favicon.png'/>
</head>
<body>

<!-- ----------------------------------------------------------------------- -->
<h1>Palomino - Configuration Module</h1>
<p>
&copy;2004,2009&nbsp;&nbsp;Jim E. Brooks
&nbsp;&nbsp;<a href='http://www.palomino3d.org'>http://www.palomino3d.org</a>
</p>
<hr>
<ul>
  <li><a href='index.html'>Index</a></li>
  <li><a href='#Configuration'>Overview</a></li>
  <li><a href='#Textual Configuration'>Textual Configuration (ConfTxt)</a></li>
  <li><a href='#Binary Configuration'>Binary Configuration (ConfBin)</a></li>
</ul>


<!-- ----------------------------------------------------------------------- -->
<hr>
<a name='Configuration'></a>
<h2>Overview of Configuration</h2>
<p><!--date-->[2007/12]</p>
<p>
Configuration is input from 3 sources (in order of precedence):
<ol>
<li>cmd-line args</li>
<li>binary configuration file (.cfg) represented by ConfBin class</li>
<li>textual configuration file (.conf) represented by ConfTxt class</li>
</ol>
</p>
<p>
The combined configuration is stored in a Conf object (C struct) which is per-module.
</p>

<!-- ----------------------------------------------------------------------- -->
<hr>
<a name='Textual Configuration'></a>
<a name='ConfTxt'></a>
<h2>Textual Configuration (ConfTxt)</h2>
<p><!--date-->[2007/12]</p>
<p>
The ConfTxt class retrieves static configuration
that the user can edit.
Textual configuration is read once at startup.
The program does not modify it (unlike ConfBin).
</p>
<p>
ConfTxt is a primitive Template Method class.
It reads a .conf file as a C++ stream and
defers the processing of lines to the abstract ProcessField().
</p>

<!-- ----------------------------------------------------------------------- -->
<hr>
<a name='Binary Configuration'></a>
<a name='ConfBin'></a>
<h2>Binary Configuration (ConfBin)</h2>
<p><!--date-->[2007/12] [2004/06]</p>
<p>
The ConfBin class stores and retrieves program state that originates from execution
(as opposed to static configuration).
</p>
<p>
The configuration files is considered binary (not intended to be user-editable)
but is in fact composed of lines of text.
The configuration is a set of key/value pairs.
A value can be 1 of 3 types: int, float, string.
The configuration file consists of lines of human-readable plain-text.
Each line defines a key/value pair.
The file terminates at a line containing "END".
For example:
</p>
<pre>
# palomino configuration (gfx::ConfigFile v2)  <i>[2007/12 old name survives since format hasn't changed]</i>
int collisions 1
int joystick 0
int joystick_axis3 1
int response_chase 0
int response_eye 0
double fog_density 0.50000000000000000000
double gui_zoom 1.00000000000000000000
string lod 3 MID
END
</pre>

<!-- ********************************* END ********************************* -->
<hr>
<p align='center'>
<font size='-2'>
<!-- hhmts start -->
Last modified: Sat Nov  7 14:46:34 CST 2009
<!-- hhmts end -->
</font>
</p>

</body>
</html>
